$(function() {

	$(mainPage.searcheInput).val(mainPage.searchDefaultVal);
	basic.hover(mainPage.hotSearch, {
		"cursor" : "pointer",
		"text-decoration" : "underline"
	}, {
		"cursor" : "default",
		"text-decoration" : "none"
	});
	$(mainPage.searcheInput).focus(function() {
		var val = $.trim($(this).val());
		if (val === mainPage.searchDefaultVal) {
			$(this).val("");
		}
	});
	$(mainPage.searcheInput).blur(function() {
		var val = $.trim($(this).val());
		if (val === mainPage.searchDefaultVal || val.length === 0) {
			$(this).val(mainPage.searchDefaultVal);
		}
	});
	basic.mouseover(mainPage.pickUp, {
		'cursor' : 'pointer'
	});
	$(mainPage.pickUp).click(function(){
		var flag = $(this).attr("flag");
	if(flag==='open'){
		var ul = $(this).parent().parent().children("ul");
		$(ul).slideUp("slow");
		$(this).attr("flag",'close');
		$(this).css('background-position','-16px 0px');
	}else if(flag==='close'){
		var ul = $(this).parent().parent().children("ul");
		$(ul).slideDown("slow");
		$(this).attr("flag",'open');
		$(this).css('background-position','0 0');
	}
		
	});
});
var mainPage = {
	searchDefaultVal : '搜帖子',
	searcheInput : '.main_p3 input',
	hotSearch : '.main_p5 li',
	pickUp : '.main_p6_1_1'
};
